package com.lfg.leetcode.leetcode100;


public class No153findMin {

    public static void main(String[] args) {
        int ret = findMin(new int[]{0, 1, 2, 4, 5, 6, 7});
        System.out.println(ret);
    }

    public static int findMin(int[] nums) {
        if (nums.length == 0) {
            return 0;
        }
        for (int i = 1; i < nums.length; i++) {
            if (nums[i] < nums[i - 1]) {
                return nums[i];
            }
        }
        return nums[0];
    }
}
